home *** CD-ROM | disk | FTP | other *** search
/ Magazyn WWW 1999 April / cd24-www.iso / prog / mac / snak / snak.hqx / Snak 2.0.2 / Scripts / repeat < prev    next >
Text File  |  1998-06-25  |  507b  |  29 lines

  1. # Kent Sorensen 06/25/98 : this file is from the standard distribution of ircII
  2.  
  3. # Use a simply while loop to repeat a command.
  4. alias repeat {
  5.     @ rep.cnt = [$0]
  6.     while ( rep.cnt > 0 )
  7.     {
  8.         $1-
  9.         @rep.cnt = rep.cnt - 1
  10.     }
  11.     ^assign -rep.cnt
  12. }
  13.  
  14. # Do the samn thing with recursion  See.. SET MAX_RECURSIONS
  15. alias recrepeat {
  16.     if ([$0] > 0)
  17.     {
  18.         $1-
  19.         recrepeat ${[$0] -1} $1-
  20.     }
  21. }
  22.     
  23. alias test {
  24.     assign blue.1 one
  25.     assign blue.2 two 
  26.     assign blue.3 three
  27.     foreach blue ii { echo $ii $blue[$ii] }
  28. }
  29.